package com.sengled.cloud.biz.union.mgt.dao.sys;

import com.sengled.cloud.biz.union.mgt.common.PageUtil;
import com.sengled.cloud.biz.union.mgt.dao.sys.provider.ShopAccountDaoProvider;
import com.sengled.cloud.biz.union.mgt.dao.sys.provider.ShopAccountModuleDaoProvider;
import com.sengled.cloud.biz.union.mgt.model.po.ShopAccount;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ShopAccountDao {
    int deleteByPrimaryKey(Long id);

    int insert(ShopAccount record);

    int insertSelective(ShopAccount record);

    @Select("select id as id,shop_id as shopId,shop_code as shopCode,shop_name as shopName from shop_account where id = #{id} ")
    ShopAccount selectByPrimaryKey(Long id);

    @Select("select id as id,shop_code as shopCode,shop_name as shopName,account_pwd as accountPwd from shop_account where account_code = #{username} and seal_mark = 0 ")
    ShopAccount selectByUsername(String username);

    int updateByPrimaryKeySelective(ShopAccount record);

    @UpdateProvider(type = ShopAccountDaoProvider.class, method = "updateShopAccountSQL")
    int updateByPrimaryKey(ShopAccount record);

    @SelectProvider(type = ShopAccountDaoProvider.class, method = "queryShopAccountSQL")
    List<ShopAccount> listShopAccount(@Param("shopAccount") ShopAccount shopAccount, @Param("pageUtil") PageUtil pageUtil);

    @SelectProvider(type = ShopAccountDaoProvider.class, method = "queryShopAccountCountSQL")
    int queryShopAccountCount(@Param("shopAccount") ShopAccount shopAccount);
}